/**
 * Created by Administrator on 2017/3/16 0016.
 */

import Relay from "react-relay";

export default class DeleteRole extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { delRole }`;
    }

    getVariables() {
        return {
            argsInput: {
                enid: this.props.enid,
                rid: this.props.rid,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on delRolePayload {
            delRole {
                errorCode
                value
                totalResult
                id
                token
                roles{
                    name
                    pid
                    roleid{
                        rid
                        enid
                    }
                    used{
                        uid
                        phone
                        name
                        status
                    }
                }
                
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
             fragment on delRolePayload {
                delRole {
                    errorCode
                    value
                    totalResult
                    id
                    token
                    roles{
                        name
                        pid
                        roleid{
                            rid
                            enid
                        }
                        used{
                            uid
                            phone
                            name
                            status
                        }
                    }
                    
                }
                }
            `]
        }];
    }

}